package com.application.Menu;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.application.R;
import com.application.gas.*;

public class GasMenu extends Activity {
    private View.OnClickListener mainListener = new View.OnClickListener() {
        public void onClick(View view) {
            int id = view.getId();
            if (id == R.id.gas_ideal) {
                Intent intent = new Intent(GasMenu.this, IdealGases.class);
                startActivity(intent);
            } else if (id == R.id.gas_combined) {
                Intent intent = new Intent(GasMenu.this, CombinedGas.class);
                startActivity(intent);
            } else if (id == R.id.gas_boyle) {
                Intent intent = new Intent(GasMenu.this, BoyleGas.class);
                startActivity(intent);
            } else if (id == R.id.gas_charles) {
                Intent intent = new Intent(GasMenu.this, CharlesGas.class);
                startActivity(intent);
            } else if (id == R.id.gas_gay) {
                Intent intent = new Intent(GasMenu.this, GayGas.class);
                startActivity(intent);
            } else if (id == R.id.gas_cancel) {
                finish();
            }
        }
    };

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.gas_layout);
        findViewById(R.id.gas_ideal).setOnClickListener(mainListener);
        findViewById(R.id.gas_cancel).setOnClickListener(mainListener);
        findViewById(R.id.gas_boyle).setOnClickListener(mainListener);
        findViewById(R.id.gas_charles).setOnClickListener(mainListener);
        findViewById(R.id.gas_gay).setOnClickListener(mainListener);
        findViewById(R.id.gas_combined).setOnClickListener(mainListener);
    }

}